﻿<%@ Page Language="C#" %>

<%@ Import Namespace="wojilu" %>
<%@ Import Namespace="wojilu.View" %>
<%@ Import Namespace="wojilu.Apps.Qycms.Domain" %>
<%@ Import Namespace="wojilu.Apps.Qycms.Service" %>

<%PowerGroup modelpowergroup = v.data("powergroup") as PowerGroup; %>
<%var bllPowerGroupService = new PowerGroupService(); %>
<%var dt = v.data("list") as System.Data.DataTable;  %>
<%var updirtype = Convert.ToInt32(v.data("updirtype")); %>
<%if(updirtype==1) { %>
<div class="infolist">
	<table border="0" style="border-collapse:collapse" width="100%" bordercolor="#FFFFFF" onclick="javascript:search('#{uploadurl}');">
			<tr>
				<td width="5%"></td>
				<td width="40%" id="left" class="padding-left3"><img src="#{path.img}ybb/images/fileicon/dir.png"> /#{dirlist}</td>
				<td width="10%"></td>
				<td width="20%"></td>
				<td width="25%" id="infotype">
					<table border="0" style="border-collapse:collapse" bordercolor="#FFFFFF">
						<tr>
							<td><a class="setedit3" href="#body" onclick="javascript:search('#{uploadurl}');" title="_{filemanage_view_updir}" hidefocus="true">_{filemanage_view_updir}</a></td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
</div>
<%} %>
<input type="hidden" name="filepath" id="filepath" value="#{dirlist}">
<%if (dt.Rows.Count > 0)  { %>
<%foreach(System.Data.DataRow row in dt.Rows) {%>
<div class="infolist">
    <%
          var bottype = string.Empty;
          if (row["type"].ToString() == "1")
          {
              bottype = "dir";
          }    
          else
          {
              bottype = Utils.GetFileExtName(row["name"].ToString());
          }
        %>
	<%if (bottype == "dir"){ %>
	<table border="0" style="border-collapse:collapse" width="100%" title="_{filemanage_view_opendir}" bordercolor="#FFFFFF" ondblClick="javascript:search('#{uploadurl1}<%=row["name"] + "/" %>');">
	<%}else { %>
	<table border="0"  style="border-collapse:collapse" width="100%" bordercolor="#FFFFFF">
	<%} %>
		<tr>
			<td width="5%"><input type="checkbox" name="selectinfoid" value="<%=row["name"].ToString() %>"></td>
			<td width="40%" id="left" class="padding-left3"><img src="#{path.img}ybb/images/fileicon/<%=bottype %>.png"> <%=row["name"].ToString().SplitString(".")[0] %></td>
			<td width="10%"><%if (bottype != "dir") { %><%=Utils.ToSize(TypeCon.CLng(row["size"].ToString())) %><%} %></td>
			<td width="20%"><%=row["lastWriteTime"] %></td>
			<td width="25%" id="infotype">
				<table border="0" style="border-collapse:collapse" bordercolor="#FFFFFF">
					<tr>
                        <%if (bottype != "dir" && (bottype == "jpg" || bottype == "gif" || bottype == "png")) { %>
						<td>
							<a class="setedit" target="_blank" href="<%=row["url"] %>" hidefocus="true">_{filemanage_view_botton}</a>
						</td>
                        <%if (bllPowerGroupService.powercheck("communicate", "fileedit", modelpowergroup)) { %>
						<td class="padding-left3">
							<a class="setedit2" onclick="javascript:parent.onbotton('_{filemanage_view_edit}','<%=link.to(new wojilu.Web.Controller.Admin.Qycms.FileController().ImageCrop) %>?dir=#{dirlist}&filename=<%=row["name"] %>&type=<%=bottype %>&freshid='+Math.random()+'&iframename='+self.frameElement.getAttribute('name'),true,'imagecrop<%=row["fid"] %>',self.frameElement.getAttribute('name'));" id="imagecrop<%=row["fid"] %>" href="#body" title="_{filemanage_view_edit}" hidefocus="true">_{filemanage_view_edit}</a>
						</td>
						<%} %>
						<%} %>
                        <%if (bllPowerGroupService.powercheck("communicate", "fileedit", modelpowergroup) && bottype == "dir") { %>
						<td class="padding-left3">
							<a class="setedit3" onclick="javascript:parent.onbotton('_{filemanage_view_rename1}','<%=link.to(new wojilu.Web.Controller.Admin.Qycms.FileController().RenameDir) %>?dir=#{dirlist}&filename=<%=row["name"] %>&type=dir&freshid='+Math.random()+'&iframename='+self.frameElement.getAttribute('name'),true,'filerename<%=row["fid"] %>',self.frameElement.getAttribute('name'));" id="filerename<%=row["fid"] %>" href="#body" title="_{filemanage_view_rename1}" hidefocus="true">_{filemanage_view_rename1}</a>
						</td>
						<%} %>
                        <%if (bllPowerGroupService.powercheck("communicate", "fileedit", modelpowergroup) && bottype != "dir") { %>
						<td class="padding-left3">
							<a class="setedit3" onclick="javascript:parent.onbotton('_{filemanage_view_rename}','<%=link.to(new wojilu.Web.Controller.Admin.Qycms.FileController().RenameDir) %>?dir=#{dirlist}&filename=<%=row["name"] %>&type=<%=bottype %>&freshid='+Math.random()+'&iframename='+self.frameElement.getAttribute('name'),true,'filerename<%=row["fid"] %>',self.frameElement.getAttribute('name'));" id="filerename<%=row["fid"] %>" href="#body" title="_{filemanage_view_rename}" hidefocus="true">_{filemanage_view_rename}</a>
						</td>
						<%} %>
					</tr>
				</table>
				
			</td>
		</tr>
	</table>
</div>
<%} %>
<%}else{ %>
<div class="infolist">
	<table border="0" style="border-collapse:collapse" width="100%" bordercolor="#FFFFFF">
		<tr>
			<td align="center">_{list_nothing_title}</td>
		</tr>
	</table>
</div>
<%} %>